<?php
require("../conn.php");    
$vi_name=($_POST['vi_name']);
$en_name=($_POST['en_name']);
$url=  $_POST['link_url'];
$order=$_POST['order'];
$parent_id = $_POST['parent_id'];
$featured = (isset($_POST['featured']))? $_POST['featured'] : 0 ;

$sql=sprintf("insert into tblmenu (url,vi_name,en_name,tblmenu.order,parent_id,featured) value('%s','%s','%s',%s,%s,%s)", $url,$vi_name,$en_name,$order,$parent_id,$featured);
//echo $sql;
$kq=mysql_query($sql)or die(mysql_error());
if(!$kq)
{
?>
	<script language="javascript">
		alert("Tạo menu không thành công!");
		location.href = "../menua";
	</script>
<?php

}
else
{
?>
	<script language="javascript">
		alert("Tạo menu thành công!");
		location.href = "../menulist";
	</script>
			

<?php
} 
?>		
